#ifndef ROOMDATAACCESSOR_H
#define ROOMDATAACCESSOR_H

#include "../../Headers/Classes/db.h"
#include "../../Headers/Classes/typeofroom.h"
#include "../../Headers/Classes/room.h"

#include <QString>
#include <QSqlTableModel>
#include <QSqlQueryModel>
#include <QSqlRelationalTableModel>
#include <QSqlQuery>

class RoomDataAccessor : public DB
{
public:
    RoomDataAccessor(QString databaseName = "kursovik.sqlite");
    QSqlRelationalTableModel * getRooms(const QString filter);
    QSqlQueryModel * getRoomQueryModel();
    QSqlQueryModel * getRoomQueryModelWithFilter(QDate arrivalDate, QDate depertureDate, int count, TypeOfRoom * type);
    bool setRoom(Room room);
    Room * getRoom(int id);
    bool deleteRoom(Room room);
    bool editRoom(Room room);
};

#endif // ROOMDATAACCESSOR_H
